<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="./vue2.js"></script>
<body>
    <div id="box" style="background-color:green;">跟组件
        <nav-Bar navbar="电影" :btn-Right="false"></nav-Bar>
        <nav-Bar navbar="影院" :btn-Right="true"></nav-Bar>
    </div>
    <script>
        Vue.component("navBar",{
            // props:["navbar","btnRight"],
            // props:{
            //     navbar:String,
            //     btnRight:Boolean,
            // },
            props:{
                navbar:{
                    type:String,
                    default:''
                },
                btnRight:{
                    type:Boolean,
                    default:true
                }
            },
            template:`<div style="background-color:yellow">
                            <button>添加</button>
                            <span>{{navbar}}</span>
                            <button v-show="btnRight">搜索</button>
                     </div>`
        })
        new Vue({
            el:'#box',
            data:{

            },
            methods:{

            }
        })
    </script>
</body>
</html>